﻿using System;
using AutoMapper;
using Colorful.Furniture.CommonDto;

namespace Colorful.Furniture.SysManagement;

public class SysManagementAutoMapperProfile : Profile
{
    public SysManagementAutoMapperProfile()
    {
        //输入
        CreateMap<SysDictionarySaveInputOutputDto, SysDictionary>();


        //输出
        CreateMap<SysDictionary, CascadeOutputDto>();

        CreateMap<SysDictionary, TreeOutputDto<Guid>>()
            .ForMember(x => x.Label, y => y.MapFrom(z => z.Title))
            .ForMember(x => x.Description, y => y.MapFrom(z => z.Remark));

        CreateMap<SysDictionary, SysDictionaryFormOutputDto>();
    }
}